function getOrderList(callback) {
    ajax(URL.ORDER, 'GET', null, callback)
}

function createOrder(payload, callback) {
    ajax(URL.ORDER, 'POST', payload, callback)
}

function repay(orderNo, callback) {
    ajax(URL.ORDER + '/' + orderNo, 'PUT', null, callback)
}

function ajax(url, method, data, success, error) {
    data = data ? JSON.stringify(data) : '';
    $.ajax({
        type: method,
        contentType: "application/json",
        url: url,
        data,
        dataType: 'json',
        cache: false,
        timeout: 300000,
        success: function (result) {
            success.call(success, result.data);
        },
        error
    });
}